<me:UIABAUFM x:Class="WPFExcelReport.TEKMU"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
                     xmlns:AB="clr-namespace:WPFExcelReport;assembly=TABPOS"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
              xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    Background="White"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIABAUFM.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
    </me:UIABAUFM.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <WrapPanel>
            <CheckBox IsChecked="{Binding IsAuto,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=自动留位}}" Margin="20,0,0,0" FontSize="18"></CheckBox>
            <WrapPanel Visibility="{Binding IsCanChg,ElementName=TV,Converter={StaticResource bv}}">
                <TextBlock Text="{Binding Source={Localization:Translate Word=预留}}"></TextBlock>
                <ex:NumericBox  DecimalPlaces="1"
                    Text="{Binding ABARESMG,Converter={StaticResource d1000}}" Width="100"/>
                <Button   Click="SaveCommand" Height="20" Margin="20,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
        </WrapPanel>
        <DataGrid   Grid.Row="1"
          AutoGenerateColumns="False" 
          EnableRowVirtualization="False"   
          Name="dlgMaster"  
          IsReadOnly="True" 
          ItemsSource="{Binding Source={StaticResource vwMaster }}" 
          HeadersVisibility="Column" 
          CanUserReorderColumns="True" 
          CanUserResizeRows="True"  
          RowDetailsVisibilityMode="VisibleWhenSelected" 
          Width="Auto" Height="Auto"
          >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFKRS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFPOS}"   Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ABARESMG,Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"  />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
   
</me:UIABAUFM>
